package lesson4.api.base;


import lesson4.api.ApplicationManager;
import lesson4.api.helpers.WebElementHelper;

import org.openqa.selenium.By;


public class PageBase
{
	// Application manager instance
	public ApplicationManager app;

	public PageBase(ApplicationManager p_app)
	{
		app = p_app;
	}

	public void click(By p_locator)
	{
		app.webElement().click(p_locator);
	}

	public void type(By p_locator, String p_text)
	{
		app.webElement().type(p_locator, p_text);
	}

	public void selectByValue(By p_locator, String p_value)
	{
		app.webElement().selectByValue(p_locator, p_value);
	}

	public String getPage()
	{
		return app.locator().getPageURL(app.testPage);
	}

	public WebElementHelper webElement()
	{
		return app.webElement();
	}

	public boolean isElementPresent(By p_locator)
	{
		return app.webElement().isElementPresent(p_locator);
	}
}
